package org.rqb.entry;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.File;
import java.io.Serializable;

@Data
@AllArgsConstructor
public class Message implements Serializable {
    private static final long serialVersionUID = 1L; // 序列化版本号
    private String sender;          // 发送人
    private String receiver;        // 接收人
    private String content;         // 消息内容
    private MessageType messageType; // 消息类型
    private File attachment;        // 附件，如图片或文件

    public enum MessageType {
        TEXT,     // 文本消息
        IMAGE,    // 图片消息
        FILE,     // 文件消息
        VIDEO     // 视频消息
    }

    public Message(String sender, String receiver, String content, MessageType messageType) {
        this.sender = sender;
        this.receiver = receiver;
        this.content = content;
        this.messageType = messageType;
    }
}
